﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;

namespace PhoneAppProject1
{
    public partial class PageDetail : PhoneApplicationPage
    {
        public PageDetail()
        {
            InitializeComponent();
        }

        private void PhoneApplicationPage_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
        	// TODO: Add event handler implementation here.
            string URL = "";
            NavigationContext.QueryString.TryGetValue("URL", out URL);
            //WebBrowser.Navigate(new Uri("http://www.ginktage.com/2011/04/launching-a-web-browser-from-windows-phone-7-app/", UriKind.RelativeOrAbsolute));
            //WebControl.Navigate(new Uri("http://weblogs.asp.net/gunnarpeipman/archive/2010/05/02/windows-phone-7-development-using-webbrowser-control.aspx", UriKind.RelativeOrAbsolute));
            //WebBrowserTask webbrowser = new WebBrowserTask();
            //webbrowser.URL = URL;
            //webbrowser.Show();
            WebClient webClientObj = new WebClient();
            webClientObj.DownloadStringCompleted += new DownloadStringCompletedEventHandler(webClientObj_DownloadStringCompleted);
            webClientObj.DownloadStringAsync(new Uri("http://api.wunderground.com/auto/wui/GeoLookupXML/index.xml?query=94107", UriKind.RelativeOrAbsolute));
            WebControl.Navigate(new Uri(URL, UriKind.RelativeOrAbsolute));
        }

        void webClientObj_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            MessageBox.Show(e.Result);
        }


    }
}
